<form action="{url()}" method="post" class="uk-form uk-form-horizontal" id="form">
    <div class="uk-form-row">
    <div class="uk-form-row">
        <label class="uk-form-label">用户名</label>
        <div class="uk-form-controls  uk-form-controls-text">
           {$info.username}
        </div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label">姓名</label>
        <div class="uk-form-controls">
            <input type="text" class="uk-form-width-large" id="nicename" name="nicename" datatype="s" value="{$info.nicename}">
        </div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label">邮箱</label>
        <div class="uk-form-controls">
            <input type="text" class="uk-form-width-large" id="email" name="email" datatype="e" value="{$info.email}">
        </div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label">QQ</label>
        <div class="uk-form-controls">
            <input type="text" class="uk-form-width-large" id="qq" name="qq" datatype="s" value="{$info.qq}">
        </div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label">密码</label>
        <div class="uk-form-controls">
            <div class="uk-form-password">
                <input type="password" class="uk-form-width-large" id="password" name="password" value=""><a href="" class="uk-form-password-toggle" data-uk-form-password="{lblShow:'显示', lblHide:'隐藏'}">显示</a>
            </div>
        </div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label">快捷菜单</label>
        <div class="uk-form-controls  uk-form-controls-text js-quick">
            <!--loop{$quickMenu as $menu}-->
                <span id="{$menu.id}">
                    <a href="javascript:;" class="uk-button"><i class="uk-icon-{$menu.icon}"></i> {$menu.name}</a>
                    <input type="hidden" name="quick[name][]" value="{$menu.name}">
                    <input type="hidden" name="quick[icon][]" value="{$menu.icon}">
                    <input type="hidden" name="quick[url][]" value="{$menu.url}">
                    <input type="hidden" name="quick[id][]" value="{$menu.id}">
                </span>
            <!--{/loop}-->
        </div>
    </div>
    <div class="uk-form-row">
        <label class="uk-form-label">选择菜单</label>
        <div class="uk-form-controls uk-form-controls-text">
           <!--loop{$SystemMenu as $topLabel => $top}-->
           <div class="uk-panel uk-panel-box uk-panel-box-primary js-quick-sl">
               <h5>{$top.name}</h5>
               <!--loop{$top['menu'] as $parentLabel => $parent}-->
               <!--loop{$parent['menu'] as $subLabel => $sub}-->
               <a href="javascript:;" class="uk-button uk-button-mini" data-id="{$topLabel}_{$parentLabel}_{$subLabel}" data-url="{$sub.url}" data-icon="{$sub.icon}" data-name="{$sub.name}"><i class="uk-icon-{$sub.icon}"></i> {$sub.name}</a>
               <!--{/loop}-->
               <!--{/loop}-->
           </div>
           <!--{/loop}-->
        </div>
    </div>
    <div class="uk-form-row">
        <label for="form-mailer" class="uk-form-label"></label>
        <div class="uk-form-controls">
            <input type="hidden" name="user_id" type="hidden" value="{$info.user_id}">
            <button class="uk-button uk-button-primary" type="submit">保存</button>
            <button class="uk-button" type="reset">重置</button>
        </div>
        
    </div>
</form>
<script>
    Do.ready('base', function () {
        $('#form').duxForm();
        $('.js-quick-sl').find('a').click(function() {
            var id = $(this).data('id');
            var html = '<span id="menu_' + id + '">\
            <a href="javascript:;" class="uk-button"><i class="uk-icon-' + $(this).data('icon') + '"></i> ' + $(this).data('name') + '</a>\
            <input type="hidden" name="quick[name][]" value="' + $(this).data('name') + '">\
            <input type="hidden" name="quick[icon][]" value="' + $(this).data('icon') + '">\
            <input type="hidden" name="quick[url][]" value="' + $(this).data('url') + '">\
            <input type="hidden" name="quick[id][]" value="' + id + '">\
            </span>';
            var num = $('.js-quick span').length;
            if(num > 9){
                $.duxTips('failure', '快捷菜单不能超过10个');
                return false;
            }
            if($('#menu_' + id).length > 0){
                $.duxTips('failure', '不能添加重复菜单');
                return false;
            }
            $('.js-quick').append(html);
        });
        $('.js-quick').on('click','a',function(){
            $(this).parent().remove();            
        });
    });
</script>